package cn.efunbox.afw.core.enums;

/**
 * Created by tomas on 2017/5/19.
 */
public enum OauthSourceEnum {
    WEIXIN("微信"),
    WEIBO("微博"),
    QQ("QQ"),
    ALI("阿里小程序");

    private String name;

    OauthSourceEnum(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static OauthSourceEnum getByName(String name) {
        if (name == null) {
            return null;
        }
        for (OauthSourceEnum itemTypeEnum : values()) {
            if (itemTypeEnum.name().equals(name)) {
                return itemTypeEnum;
            }
        }
        return null;
    }
}
